﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.WinControls.UI;
using Telerik.WinControls;
using MySQLStudio.BusinessLogic;

namespace MySQLStudio.GUI.Controls
{
    public partial class ObjectsExplorer : Telerik.WinControls.UI.RadTreeView
    {
        /// <summary>
        /// Generates databases nodes in tree
        /// </summary>
        /// <param name="lstDatabases"></param>
        public void GeneratesDatabases(List<MySQLStudio.BusinessLogic.Database> lstDatabases)
        {
            RadTreeNode hostNode = new RadTreeNode("localhost");

            foreach (MySQLStudio.BusinessLogic.Database database in lstDatabases)
            {
                RadTreeNode databaseNode = new RadTreeNode(database.Name);
                hostNode.Nodes.Add(databaseNode);
            }

            this.Nodes.Add(hostNode);
        }

    }
}
